package org.example.design.chainofresponsibility.test1;

/**
 * @author huangshen
 * @version 0
 * @description 解决指定编号的问题
 * @since 2022/2/10 11:07
 */
public class SpecialSupport extends Support {

    private final int number;

    public SpecialSupport(String name,int number) {
        super(name);
        this.number = number;
    }

    /**
     * 解决问题的方法
     *
     * @param trouble
     * @return boolean
     */
    @Override
    protected boolean resolve(Trouble trouble) {
        return trouble.getNumber() == number;
    }
}
